scale: remove impossible case
authorCosimo Cecchi <cosimoc@gnome.org>
Sun, 27 Mar 2016 02:11:41 +0000 (19:11 -0700)
committerCosimo Cecchi <cosimoc@gnome.org>
Sun, 27 Mar 2016 05:43:53 +0000 (22:43 -0700)
We only create the gadget when the markup is not empty, so we don't
need to check again here.

gtk/gtkscale.c

index 0b0c76163793e58c6c75eddf68b08e21f3e816d1..17a2e8bfd96ca92bea76355bdd4cb7ba341064e1 100644 (file)
@@ -1539,26 +1539,22 @@ gtk_scale_measure_mark_label (GtkCssGadget   *gadget,
 {
   GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
   GtkScaleMark *mark = user_data;
+  PangoRectangle logical_rect;
 
   *minimum = *natural = 0;
 
-  if (mark->markup)
+  if (!mark->layout)
     {
-      PangoRectangle logical_rect;
-
-      if (!mark->layout)
-        {
-          mark->layout = gtk_widget_create_pango_layout (widget, NULL);
-          pango_layout_set_markup (mark->layout, mark->markup, -1);
-        }
+      mark->layout = gtk_widget_create_pango_layout (widget, NULL);
+      pango_layout_set_markup (mark->layout, mark->markup, -1);
+    }
 
-      pango_layout_get_pixel_extents (mark->layout, NULL, &logical_rect);
+  pango_layout_get_pixel_extents (mark->layout, NULL, &logical_rect);
 
-      if (orientation == GTK_ORIENTATION_HORIZONTAL)
-        *minimum = *natural = logical_rect.width;
-      else
-        *minimum = *natural = logical_rect.height;
-    }
+  if (orientation == GTK_ORIENTATION_HORIZONTAL)
+    *minimum = *natural = logical_rect.width;
+  else
+    *minimum = *natural = logical_rect.height;
 }
 
 static void